package aufgabe_05;



public class Rechenmaschine {

	private enum Operation{
		PLUS{
			public double eval(double arg0, double arg1){
				return arg0 + arg1;
			}
		},
		MINUS{
			public double eval(double arg0, double arg1){
				return arg0 - arg1;
			}
		},
		TIMES{
			public double eval(double arg0, double arg1){
				return arg0 * arg1;
			}
		},
		DIVIDE{
			public double eval(double arg0, double arg1){
				return arg0 / arg1;}
		};
		public abstract double eval(double arg0, double arg1);
		};
		
		public void ausfuehren( Operation o, double d1, double d2)
		{
			 
			System.out.println("Die Operation " + o.toString() + " ergibt fuer die Argumente " + d1 + " und " + d2 + " das Ergebnis " + o.eval(d1,d2) );
					
		}
	
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
			Rechenmaschine rm = new Rechenmaschine();
			
			for (Operation o : Operation.values() ) {
				rm.ausfuehren(o, 2, 3);
			}
		
		
	}

}
